<template>
  <div class="Census">
    <keep-alive>
      <component :is="['MyData', 'CensusDetail', 'ShoperBill'][active]" @change="(a) => active = a"/>
    </keep-alive>
  </div>
</template>

<script>
import MyData from './MyData/index.vue';
import CensusDetail from './CensusDetail/index.vue';
import ShoperBill from './shoperBill.vue';

export default {
  components: { MyData, CensusDetail, ShoperBill },
  data() {
    return {
      active: 0
    };
  },
  created() {
    if (this.$store.getters.ifShoper) this.active = 2;
  },
  mounted() { 
  }
};
</script>

<style lang="less">
.Census {
  width: 100%;
  height: 100%;
  .header-nav {
    height: 1.1rem;
    display: flex;
    flex-direction: row;
    box-sizing: border-box;
    padding: 0 0.4rem;
    align-items: flex-end;
    margin-top: 0.1rem;
    div {
      font-size: 14px;
      color: #d0e6fe;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      margin-right: 1rem;
      &::after {
        content: '';
        width: 0.61rem;
        height: 0.08rem;
        border-radius: 0.04rem;
        margin-top: 0.23rem;
      }
      &.active {
        color: #ffffff;
        font-weight: bold;
        &::after {
          background-color: #ffffff;
        }
      }
    }
  }
  .header-btn {
    width: 1.81rem; 
    height: 0.61rem; 
    line-height: 0.61rem; 
    text-align: center; 
    border-radius: 0.31rem; 
    border: solid 0.03rem #ffffff;
    position: absolute;
    top: 0.3rem;
    right: 0.4rem;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
  }
  .census-item {
    box-sizing: border-box;
    padding: 0 0.4rem;
    margin-top: 0.27rem;
    background: #fff;
    overflow: hidden;
    .census-item-header {
      height: 1.2rem;
      display: flex;
      align-items: center;
      flex-direction: row;
      font-size: 0.43rem;
      color: #333;
      font-weight: bold;
      &::before {
        content: '';
        width: 0.05rem;
        height: 0.35rem;
        background-color: #3563f5;
        border-radius: 0.03rem;
        margin-right: 0.15rem;
      }
    }
    .info-row {
      width: 9.2rem;
      height: 1.07rem;
      background-color: #f8f9fd;
      border-radius: 0.13rem;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      box-sizing: border-box;
      padding: 0 0.27rem 0 0.4rem;
      margin-bottom: 0.27rem;
      img {
        width: 0.61rem;
      }
      .label {
        margin-left: 0.4rem;
        font-size: 12px;
        color: #000;
        font-weight: bold;
        flex: 1;
      }
      .value {
        margin-right: 0.25rem;
        font-size: 14px;
        color: #000;
        font-weight: bold;
        flex: 1;
        text-align: right;
      }
      .right {
        width: 0.35rem;
        height: 0.35rem;
      }
    }
  }
}
</style>
